package com.xxl.job.kettle.core.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.xxl.job.kettle.core.entity.KScriptRecord;
import com.xxl.job.kettle.core.mapper.KScriptRecordMapper;
import com.xxl.job.kettle.core.service.KScriptRecordService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 实现功能：
 *
 * @author 作者[zk]
 * @version 1.0.00  2022-11-29 21:11
 */
@Service
public class KScriptRecordServiceImpl extends BaseServiceImpl<KScriptRecordMapper, KScriptRecord> implements KScriptRecordService {
    @Override
    public PageInfo<KScriptRecord> findTransRecordList(KScriptRecord kScriptRecord, Integer page, Integer rows) {
        PageHelper.startPage(page,rows);
        List<KScriptRecord> scriptRecords = baseMapper.selectAllBySid(kScriptRecord);
        PageInfo<KScriptRecord> pageInfo = new PageInfo<>(scriptRecords);
        return pageInfo;
    }

    @Override
    public List<KScriptRecord> selectErrorList(KScriptRecord kScriptRecord) {
        return baseMapper.selectErrorList(kScriptRecord);
    }

    @Override
    public List<Map> get7DayScriptRunstatusForMysql() {
        return baseMapper.get7DayScriptRunstatusForMysql();
    }
}
